icc_write (s15f16, state->o + 12, space->RGBtoXYZ[5]);
icc_write (s15f16, state->o + 16, space->RGBtoXYZ[8]);
+
write_trc (state, "rTRC", &space->trc[0]->trc);
if (space->trc[0] == space->trc[1] &&
#endif
memcpy (space->XYZtoRGB, mat, sizeof (mat));
+
+ babl_matrix_to_float (space->RGBtoXYZ, space->RGBtoXYZf);
+ babl_matrix_to_float (space->XYZtoRGB, space->XYZtoRGBf);
}
const Babl *
static BablSpace space;
space.instance.class_type = BABL_SPACE;
space.instance.id = 0;
-
space.xr = rx;
space.yr = gx;
space.xg = bx;
space.RGBtoXYZ[6] = rz;
space.RGBtoXYZ[7] = gz;
space.RGBtoXYZ[8] = bz;
+
babl_matrix_invert (space.RGBtoXYZ, space.XYZtoRGB);
babl_matrix_to_float (space.RGBtoXYZ, space.RGBtoXYZf);
if (name)
sprintf (space_db[i].name, "%s", name);
else
+ /* XXX: this can get longer than 256bytes ! */
sprintf (space_db[i].name, "space-%.4f,%.4f_%.4f,%.4f_%.4f,%.4f_%.4f,%.4f_%s,%s,%s",
wx,wy,rx,ry,bx,by,gx,gy,babl_get_name (space.trc[0]),
babl_get_name(space.trc[1]), babl_get_name(space.trc[2]));
double pad; // for when the numbers represent a matrix
const Babl *trc[3];
- char name[128];
+ char name[512]; // XXX: allocate this dynamically instead -
+ // or use iccv4 style hashes for name.
double whitepoint[3]; /* CIE XYZ whitepoint */
double RGBtoXYZ[9]; /* matrices for conversions */